package com.walkingfiles.registry

class Transfer {

	TransferSubject subject

	Area sourceArea
	Date sendDate
	User sendUser
	Comment sendComment

	Area destinationArea
	Date receptionDate
	User receptionUser
	Comment receptionComment

	Date modifiedDate
	
	static hasMany = [transferDocuments:TransferDocument]
	
    static constraints = {
	transferDocuments(minSize:1)
	sendComment(nullable:true)
	receptionDate(nullable:true)
	receptionUser(nullable:true)
	receptionComment(nullable:true)
    }

    static mapping = {
		table 'Transfers'
	    sendComment cascade: 'save-update'
	    receptionComment cascade: 'save-update'
	    transferDocuments cascade: 'save-update'
    }
}
